sql ="select * from article where (content like '%"&checkStr(ttt)&"%') order by dateandtime Desc"

来源:百度知道 编辑:UC知道 时间:2024/09/23 00:24:20
sql ="select * from article where (content like '%"&checkStr(ttt)&"%') order by dateandtime Desc"
报错checkstr与vb类型不匹配怎么改成vb的?急急急!
<%
mmm=request("mmm")
if mmm="" then mmm=0'设置初始页数
sss=request("sss")'得到搜索的方式
ttt=request("ttt")'得到搜索的关键字
ttt=LTRIM(RTRIM(ttt))'对ttt去掉左右空格
if sss="按新闻标题搜索" then
set rs=server.createobject("adodb.recordset")
'按新闻标题搜索含有ttt的所有文章
sql ="select * from article where (title like '%"&checkStr(ttt)&"%') order by dateandtime Desc"
rs.open sql,conn,1,1%>我不知道如何定义能指点吗?能直接帮忙定义吗?

checkstr()函数没定义,定义一个啊。
checkstr()函数显然是要处理字符串ttt,要写出函数来就要知道想要怎么处理字符串。
随便写一个:
function checkStr(s)
s=replace(s,"'","''")
s=replace(s,"[","[[]")
end function